Skip to content

fix(dictation): drop the 2048-char llm_instruction cap the API no longer enforces - #319

Open
mayankbohradev wants to merge 2 commits into
AssemblyAI:masterfrom
mayankbohradev:fix/dictation-llm-instruction-no-cap
Open

mayankbohradev wants to merge 2 commits into
AssemblyAI:masterfrom
mayankbohradev:fix/dictation-llm-instruction-no-cap

Conversation

@mayankbohradev

@mayankbohradev mayankbohradev commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What

DictationConfig no longer rejects an llm_instruction longer than 2048 characters. The limit is now left to the service.

Why

Fixes #300. The SDK refused instructions the Dictation API accepts. The reporter measured lengths from 2,049 to 10,000 characters returning 200, and AssemblyAI's own re-probe in AssemblyAI/blurt#322 (18 Nov) found 2,049–49,152 characters accepted in both rewrite modes. In that probe the service limits only the size of the whole config part, and Blurt dropped its own cap. The public docs give caps for stt_prompt and keyterms_prompt, but none for llm_instruction.

How

Testing

  • Replaced the cap test with three tests: a 49,152-char instruction is accepted, a 10,000-char instruction reaches the config part whole, and a 400 config part too large raises DictationError.
  • pytest tests/unit passes with pydantic v2 and on the pydantic.v1 fallback. ruff check and ruff format --check are clean on the changed files.

Notes for reviewers

The Node SDK has the same cap (assemblyai-node-sdk#224).

…ger enforces

DictationConfig rejected any llm_instruction over 2048 characters before
sending, but the Dictation API accepts much longer instructions; only the
whole config part is size-limited server-side. Leave the limit to the
service, whose 400 already surfaces as DictationError.

Fixes AssemblyAI#300

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

llm_instruction: docs/SDK cap of 2048 chars is not enforced by the API (10,000 accepted)

1 participant